﻿using System.Data.Common;
using Abp.Zero.EntityFramework;
using KDS.Mes.Authorization.Roles;
using KDS.Mes.MultiTenancy;
using KDS.Mes.Users;
using KDS.Mes.Mes.Factorys;
using System.Data.Entity;
using KDS.Mes.Mes.Workshops;
using KDS.Mes.Mes.Lines;
using KDS.Mes.Mes.Stations;
using KDS.Mes.Mes.Cartypes;
using KDS.Mes.Mes.Alcs;
using KDS.Mes.Mes.Styles;
using KDS.Mes.Mes.AlcCodes;
using KDS.Mes.Mes.SeatPositions;
using KDS.Mes.Mes.Colors;
using KDS.Mes.Mes.Materials;
using KDS.Mes.Mes.Parts;
using KDS.Mes.Mes.SeatInfos;
using KDS.Mes.Mes.Storages;
using KDS.Mes.Mes.PlanModes;
using KDS.Mes.Mes.Plans;
using KDS.Mes.Mes.LineAlcCodes;
using KDS.Mes.Mes.ProcessTypes;
using KDS.Mes.Mes.PlanDetails;
using KDS.Mes.Mes.ProductModes;
using KDS.Mes.Mes.Onlines;
using KDS.Mes.Mes.SeqJits;
using KDS.Mes.Mes.StorageAlcCodes;
using KDS.Mes.Mes.JitAlcCodes;
using KDS.Mes.Mes.TestSlides;
using KDS.Mes.Mes.TestPower2s;
using KDS.Mes.Mes.TestImss;
using KDS.Mes.Mes.TestRlifts;
using KDS.Mes.Mes.Atlas;
using KDS.Mes.Mes.Andons;
using KDS.Mes.Mes.StopEquipments;

namespace KDS.Mes.EntityFramework
{
    public class MesDbContext : AbpZeroDbContext<Tenant, Role, User>
    {
        //TODO: Define an IDbSet for your Entities...
        public virtual IDbSet<ANDON> ANDONs { get; set; }
        public virtual IDbSet<Factory> Factorys { get; set; }

        public virtual IDbSet<Workshop> Workshops { get; set; }

        public virtual IDbSet<Line> Lines { get; set; }

        public virtual IDbSet<Station> Stations { get; set; }

        public virtual IDbSet<Cartype> Cartypes { get; set; }

        public virtual IDbSet<Alc> Alcs { get; set; }

        public virtual IDbSet<Style> Styles { get; set; }

        public virtual IDbSet<AlcCode> AlcCodes { get; set; }

        public virtual IDbSet<SeatPosition> SeatPositions { get; set; }

        public virtual IDbSet<Color> Colors { get; set; }

        public virtual IDbSet<Material> Materials { get; set; }

        public virtual IDbSet<Part> Parts { get; set; }

        public virtual IDbSet<StopEquipment> StopEquipment { get; set; }

        public virtual IDbSet<SeatInfo> SeatInfos { get; set; }

        public virtual IDbSet<Storage> Storages { get; set; }

        public virtual IDbSet<PlanMode> PlanModes { get; set; }

        public virtual IDbSet<Plan> Plans { get; set; }

        public virtual IDbSet<LineAlcCode> LineAlcCodes { get; set; }

        public virtual IDbSet<ProcessType> ProcessTypes { get; set; }

        public virtual IDbSet<PlanDetail> PlanDetails { get; set; }

        public virtual IDbSet<ProductMode> ProductModes { get; set; }

        public virtual IDbSet<Online> Onlines { get; set; }

        public virtual IDbSet<SeqJit> SeqJits { get; set; }

        public virtual IDbSet<StorageAlcCode> StorageAlcCodes { get; set; }

        public virtual IDbSet<JitAlcCode> JitAlcCodes { get; set; }

        public virtual IDbSet<TestSlide> TestSlides { get; set; }

        public virtual IDbSet<TestPower2> TestPower2s { get; set; }

        public virtual IDbSet<TestIms> TestImss { get; set; }

        public virtual IDbSet<TestRlift> TestRlifts { get; set; }

        public virtual IDbSet<Atlas> Altass { get; set; }


        /* NOTE: 
         *   Setting "Default" to base class helps us when working migration commands on Package Manager Console.
         *   But it may cause problems when working Migrate.exe of EF. If you will apply migrations on command line, do not
         *   pass connection string name to base classes. ABP works either way.
         */
        public MesDbContext()
            : base("Default")
        {

        }

        /* NOTE:
         *   This constructor is used by ABP to pass connection string defined in MesDataModule.PreInitialize.
         *   Notice that, actually you will not directly create an instance of MesDbContext since ABP automatically handles it.
         */
        public MesDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        //This constructor is used in tests
        public MesDbContext(DbConnection existingConnection)
         : base(existingConnection, false)
        {

        }

        public MesDbContext(DbConnection existingConnection, bool contextOwnsConnection)
         : base(existingConnection, contextOwnsConnection)
        {

        }
    }
}
